from sklearn.cluster import KMeans
import numpy as np

# 创建数据
X = np.array([[1, 2], [2, 3], [8, 7], [9, 8]])

# 训练模型
model = KMeans(n_clusters=2)
model.fit(X)

# 聚类结果
print("Cluster labels:", model.labels_)